import service from '@/utils/request.js'

// 获取部门列表
export const getDepartments = _ => service.get('/company/department')

// 新增部门
export const addDepartment = ({ code, introduce, manager, name, pid }) => service.post('/company/department', { code, introduce, manager, name, pid })

// 删除部门
export const deleteDepartment = id => service.delete('/company/department/' + id)

// 查询部门详情
export const getDepartmentDetails = id => service.get('/company/department/' + id)

// 修改部门
export const editDepartment = ({ code, companyId, createTime, id, introduce, manager, managerId, name, pid }) => service.put(`/company/department/${id}`, { code, companyId, createTime, id, introduce, manager, managerId, name, pid })
